<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视频列表</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="common_css"/>
    <!--<link href="__PUBLIC__/admin/css/video.css" rel="stylesheet">-->
    <style>
        .fa-trash-o{font-size:15px;}
        .img-responsive{height:100%;width:100%;}
    </style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <!--<div class="col-sm-4">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>添加视频</h5>
                            </div>
                            <div class="ibox-content" style="border:1px solid red;">
                                <video id="sampleMovie" width="100%" height="360" preload controls>
                                    <source class="source" src="" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
                                    <source class="source" src="" type='video/ogg; codecs="theora, vorbis"' />
                                    <source class="source" src="" type='video/webm; codecs="vp8, vorbis"' />
                                    <object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="100%" height="360">
                                        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
                                        <param name="allowFullScreen" value="true" />
                                        <param name="wmode" value="transparent" />
                                        <param name="flashvars" value='config={"clip":{"url":"__PUBLIC__/home/Video/introduce.flv","autoPlay":false,"autoBuffering":true}}' />
                                    </object>
                                </video>
                            </div>
                        </div>
                    </div>
                </div>
            </div>-->
            <div class="col-sm-12 animated fadeInRight">
                <button type="button" style="float:right;" onclick="layer_show('添加','__URL__/addVideoView',980,700)" class="btn btn-outline btn-info">添加视频>></button>
                <div class="row">
                    <div class="col-sm-12">
                        <volist name="list" id="vo">
                            <div class="file-box">
                                <div class="file">
                                    <a>
                                        <div class="image">
                                            <img alt="image" class="img-responsive" src="__ROOT__/{$vo.img}">
                                        </div>
                                        <div class="file-name">
                                            {$vo.title}
                                            <br/>
                                            <small>添加时间：{$vo.time|date='Y-m-d H:i:s',###}</small>
                                        </div>
                                    </a>
                                </div>
                                <div style="text-align: center;">
                                    <button type="button" onclick="layer_show('编辑','__URL__/videoDetail/id/{$vo.id}',980,700)" class="btn btn-outline btn-info">编辑</button>
                                    <button type="button" onclick="deleteVideo('{$vo.id}')" class="btn btn-outline btn-danger">删除</button>
                                </div>
                            </div>
                        </volist>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 全局js -->
    <include file="common_js"/>
    <!-- 自定义js -->
    <script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
    <script src="__PUBLIC__/common/layer/layershow.js" type="text/javascript"></script>
    <script>
        var index;
        $(document).ready(function () {

        });

        function deleteVideo(id){/*删除视屏*/
            layer.confirm("您确定要删除吗?",function(){
                index = layer.load();
                $.ajax({
                    type:"POST",
                    url:"__URL__/deleteVideo",
                    dataType:'json',
                    data:{id:id},
                    success:function(data){
//                        console.log(data);
                        //alert(JSON.stringify(data));return;
                        layer.close(index);
                        if(data.status==1){
                            layer.msg(data.msg,{icon: 1, time: 2000});
                            location.reload();
                        }else{
                            layer.msg(data.msg,{icon: 2, time: 2000});
                        }
                    },error:function(err){
                        console.log(err);
                        layer.close(index);
                        layer.msg('网络错误',{icon: 2, time: 2000});
                    }
                });
            })
        }
    </script>
</body>

</html>
